<template>
  <div class="app-container">
    <el-card class="form-container" shadow="never">
      <el-form label-width="120px">
        <el-form-item label="标签名称">
          <el-input v-model="tags.tag"></el-input>
        </el-form-item>
        
        <el-form-item>
          <el-button
            :disabled="saveBtnDisabled"
            type="primary"
            @click="save"
            >保存</el-button
          >
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>
<script>
import tags from '@/api/tags'
export default {
  data() {
    return {
        tags:{
            tag:''
        },
              //是否禁用保存按钮
      saveBtnDisabled: false,
    };
  },
  created() {},
  methods: {
      save(){
          tags.addTag(this.tags).then(res=>{
              this.saveBtnDisabled= true,
              this.$message.success("添加成功");
              console.log(res)
          })

      }
  },
};
</script>